package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AppOrderFallBack;
import cn.cs.pojo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = AppOrderFallBack.class)
public interface RestAppOrderClient {
    @RequestMapping(value = "/getAppOrderById", method = RequestMethod.POST)
    AppOrder getAppOrderById(@RequestParam("appId") String appId);

    @RequestMapping(value = "/updateAppOrderState", method = RequestMethod.POST)
    void updateAppOrderState(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getParentFaultType", method = RequestMethod.POST)
    String getParentFaultType(@RequestParam("fault_category") String fault_category);

    @RequestMapping(value = "/getAllAppOrders", method = RequestMethod.POST)
    List<AppOrder> getAllAppOrders(@RequestBody Map<String, Object> param);

    @RequestMapping(value = "/getAllAfterOrders", method = RequestMethod.POST)
    List<AfterOrder> getAllAfterOrders(@RequestParam("s") String s);

    @RequestMapping(value = "/updateAppOrder", method = RequestMethod.POST)
    int updateAppOrder(@RequestBody AppOrder appOrder);

    @RequestMapping(value = "/getUserFullAddressByid", method = RequestMethod.POST)
    String getUserFullAddressByid(@RequestParam("userAddressId")String userAddressId);



    @RequestMapping(value = "/getUserAddressListById", method = RequestMethod.POST)
    public List<UserAddress> getUserAddressListById(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getClientRepRelListByMap", method = RequestMethod.POST)
    public List<ClientRepRel> getClientRepRelListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderByAppOrderId", method = RequestMethod.POST)
    public Map<String,Object> getAppOrderByAppOrderId(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getAppOrderCountByMap", method = RequestMethod.POST)
    public Integer getAppOrderCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/itriptxAddAppOrder", method = RequestMethod.POST)
    public Integer itriptxAddAppOrder(@RequestBody AppOrder appOrder)throws Exception;

    @RequestMapping(value = "/modifyAppOrder", method = RequestMethod.POST)
    public Integer modifyAppOrder(@RequestBody AppOrder appOrder)throws Exception;

    @RequestMapping(value = "/getRepUserIdByAppOrderId", method = RequestMethod.POST)
    public Map<String, Object> getRepUserIdByAppOrderId(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/itriptxDeleteAppOrderById", method = RequestMethod.POST)
    public Integer itriptxDeleteAppOrderById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/getOverTimeAppOrderList", method = RequestMethod.POST)
    public List<Map<String, Object>> getOverTimeAppOrderList();

    @RequestMapping(value = "/getCourierServices", method = RequestMethod.POST)
    public List<Map<String, Object>> getCourierServices();

    @RequestMapping(value = "/saveCourierServices", method = RequestMethod.POST)
    public Integer saveCourierServices(@RequestParam("courierCompany") String courierCompany, @RequestParam("courierNumber") String courierNumber, @RequestParam("id") String id);

    @RequestMapping(value = "/insertUserAddress", method = RequestMethod.POST)
    public Integer insertUserAddress(@RequestBody UserAddress userAddress)throws Exception;

    @RequestMapping(value = "/getRepairUserById", method = RequestMethod.POST)
    public RepairUser getRepairUserById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/getRepairUserAddressByAreaId", method = RequestMethod.POST)
    public Map<String, Object> getRepairUserAddressByAreaId(@RequestParam("repairUserId") String repairUserId, @RequestParam("area") String area)throws Exception;

    @RequestMapping(value = "/updateClientUser", method = RequestMethod.POST)
    public Integer updateClientUser(@RequestBody ClientUser clientUser)throws Exception;

    @RequestMapping(value = "/getRepairUserByAreaId", method = RequestMethod.POST)
    public List<Map<String,Object>> getRepairUserByAreaId(@RequestParam("area") String area)throws Exception;

    @RequestMapping(value = "/toRepairOrder", method = RequestMethod.POST)
    public  void toRepairOrder(@RequestBody RepOrder repOrder) throws Exception;

    @RequestMapping(value = "/getAppOrderListByMap", method = RequestMethod.POST)
    public List<Map<String,Object>>	getAppOrderListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAreaIdByOrderId", method = RequestMethod.POST)
    public Map<String,String> getAreaIdByOrderId(@RequestParam("orderId") String orderId);

    @RequestMapping(value = "/getRepairUserDayByMap", method = RequestMethod.POST)
    public List<Map<String, Object>> getRepairUserDayByMap(@RequestBody Map<String, Object> param);

    @RequestMapping(value = "/getRepairUserDayByMapCount", method = RequestMethod.POST)
    public Integer getRepairUserDayByMapCount(@RequestBody Map<String, Object> param);

    @RequestMapping(value = "/userRepairApplyOrder", method = RequestMethod.POST)
    public Integer userRepairApplyOrder(@RequestBody AppOrder appOrder)throws Exception;
}
